package com.holyland.util;

import org.apache.commons.lang.StringUtils;

public enum Gender {
	Male("M", "Laki-laki"), Female("F", "Perempuan");
	
	private String code;
	private String desc;
	
	private Gender(String c, String d) {
		this.code = c;
		this.desc = d;
	}
	
	public String getCode() {
		return code;
	}
	public String getDesc() {
		return desc;
	}
	
	public static String getDesc(String code) {
		String desc = "";
		
		if(StringUtils.equals("M", code)) {
			desc = Male.getDesc();
		} else if(StringUtils.equals("F", code)) {
			desc = Female.getDesc();
		}
		
		return desc;		
	}
		
}
